﻿Imports Microsoft.VisualBasic

Public Class Carta
    'identificador de la carta
    Private id As String
    Private nombre As String
    Private descripcion As String

    Public Sub New(ByVal idCarta As String, ByVal nombreCarta As String, ByVal descripcionCarta As String)
        id = idCarta
        nombre = nombreCarta
        descripcion = descripcionCarta
    End Sub

    Public Function getId() As String
        Return id
    End Function

    Public Function getNombre() As String
        Return nombre
    End Function

    Public Function getDescripcion() As String
        Return descripcion
    End Function

    Public Overloads Function compareTo(ByVal o As Object) As Integer Implements Icomparable.compareTo
        If TypeOf o Is Carta Then
            Dim c As Carta = CType(o, Carta)

            Return getId().CompareTo(c.getId())
        End If

        Throw New ArgumentException("El objeto pasado no es de tipo Carta")
    End Function







End Class
